<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="hmg.common.CommonUtils"%>
<%@ page import="able.com.vo.SearchVO"%>
<%@ page import="hmg.vo.CodeVO"%>
<%@ page import="hmg.vo.BoardVO"%>
<%@ page import="java.util.List"%>
<%--
    JSP Name : jspName.jsp
    Description : 설명을 기술합니다.
    author Kim hyung soo
    since 2012. 9. 25.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 9. 25.     Kim hyung soo     최초 생성
--%>
<%
    List<BoardVO> funcList = (List<BoardVO>) request.getAttribute("FuncList");
    List<BoardVO> introList = (List<BoardVO>) request.getAttribute("IntroList");
    Integer totalIntros = (Integer) request.getAttribute("TotalIntros");
    List<CodeVO> bizList = (List<CodeVO>) request.getAttribute("BizList");
    List<CodeVO> compList = (List<CodeVO>) request.getAttribute("CompList");

    String compType = CommonUtils.getParameter(request.getParameter("compType"), "1");
    String searchKeyword = CommonUtils.getDecodedParameter(request.getParameter("searchKeyword"), "");
    String currPage = CommonUtils.getParameter(request.getParameter("page"), "1");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ko" xml:lang="ko" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>직무 소개 | 현대자동차그룹</title>
<meta name="description" content="현대자동차그룹 계열사별 직무 소개" />
<meta name="keywords" content="현대자동차그룹 직무, 현대차그룹 직무, 계열사 직무, 직무" />
<%@ include file="/WEB-INF/jsp/web/kor/include/headerRecruit.jspf" %>
<script type="text/javascript">
//<![CDATA[
var page = "<%= currPage %>";

$(document).ready(function(){
    $(".companyWrap .compListClose").click(function(){
        $(".companyWrap").slideUp(200);
    });

    if (page == "")
        page = "1";

    if (<%= totalIntros %> <= 100)
        $("#paging_div").hide();
    else
        $("#paging").html(getNewsPagingString(<%= totalIntros %>, page, 100, 10));

    $('#btn-top').click ( function () {
        $('.jspDrag').css({'top':'0px'});
        $('.jspPane').css({'top':'0px'});
    });
    $('.menu_btn .open').click ( function () {
        $('#btn-top').animate({"left":"948px"});
    });
    $('.menu_btn .close').click ( function () {
        $('#btn-top').animate({"left":"1108px"});
    });
});

$(function(){
    $(".introduction dl:last-child").css('border','none');
});

function fn_move_by_func(keyword) {
    document.location.href = "./JobIntroduction.do?compType=<%= compType %>&searchKeyword=" + escape(encodeURIComponent(keyword)) + "&page=1";
}

function fn_move_page(pageNo){
    fn_common_move_page(pageNo, location.search, page, 100, <%= totalIntros %>, "./JobIntroduction.do");
}

//]]>
</script>
</head>
<body>
    <!--wrap-->
    <div id="wrap">
        <!-- skip navigation -->
        <div id="skipnavition">
            <a href="#gnb">메뉴바로가기</a><a href="#content">본문바로가기</a>
        </div>
        <!--// skip navigation -->

        <hr />

        <!-- header-->
        <%@ include file="/WEB-INF/jsp/web/kor/include/leftEtc.jspf" %>
        <!--//header-->

        <hr />

        <!--container-->
        <div id="container">
            <div class="scroll-pane">
                <!--contents-->
                <div id="content">
                    <!--<h1><img src="/hmg/images/web/kor/gbc/gbc_logo.gif" alt="HYUNDAI MOTOR GROUP" /></h1>-->
                    <!--recruit-->
                    <div class="recurit_Wrap">
                        <h2><img src="/hmg/images/web/kor/job/recruit_title.png" alt="인재채용" /></h2>
                        <h3><img src="/hmg/images/web/kor/job/introduce-tit.png" alt="직무소개 - 직국에 따른 분야별 업무와 내용을 알려드립니다." /></h3>
                        <!-- 내용 -->
                        <div class="recurit_contents">
                            <div class="pageLocation">
                                <ul>
                                    <li class="home"><a href="/hmg/web/kor/Main.do"><img src="/hmg/images/web/kor/common/location_home.gif" alt="홈" /></a></li>
                                    <li><a href="/hmg/web/kor/job/JobSubMain.do">인재채용</a></li>
                                    <li class="nowPage"><a href="./JobIntroduction.do">직무소개</a></li>
                                </ul>
                            </div>

                            <div class="link_box">
                                <ul>
                                    <li><a href="/hmg/web/kor/job/tln/Talent.do"><img src="/hmg/images/web/kor/job/quickmenu_img01.png" alt="인재상소개"  /></a></li>
                                    <li><a href="/hmg/web/kor/job/int/JobIntroductionMain.do"><img src="/hmg/images/web/kor/job/quickmenu_img02.png" alt="직무 소개"  /></a></li>
                                    <li><a href="/hmg/web/kor/job/itv/JobInterviewList.do"><img src="/hmg/images/web/kor/job/quickmenu_img03.png" alt="직무 인터뷰"  /></a></li>
                                    <li><a href="/hmg/web/kor/job/grp/GroupPeopleList.do"><img src="/hmg/images/web/kor/job/quickmenu_img04.png" alt="그룹사람들"  /></a></li>
                                    <li class="last"><a href="/hmg/web/kor/job/rct/RecruitList.do"><img src="/hmg/images/web/kor/job/quickmenu_img05.png" alt="채용정보"  /></a></li>
                                </ul>
                            </div>

                            <div class="job_Introduction">
                                <div class="groupNews_Btn03">
                                    <h2><img src="/hmg/images/web/kor/title/jobList-tit<%= compType %>.gif" alt="해당계열사 직무부문" /></h2>
                                    <div class="right_Btn">
                                        <a href="#"><img src="/hmg/images/web/kor/btn/btn_select.gif" alt="계열사 선택" /></a>
                                    </div>

                                    <!--companyWrap-->
                                    <div class="companyWrap interviewType">
                                        <div class="companyList">
                                            <table summary="계열사 목록">
                                                <caption>계열사목록</caption>
                                                <thead>
                                                    <tr>
<%
    for (int idx = 0; idx < bizList.size(); idx++) {
        CodeVO biz = bizList.get(idx);

        if (idx + 1 < bizList.size())
            out.println("                                        <th scope=\"col\">" + biz.getNameKo() + "</th>");
        else
            out.println("                                        <th scope=\"col\" class=\"last\">" + biz.getNameKo() + "</th>");
    }
%>
                                                    </tr>
                                                </thead>

                                                <tbody>
                                                    <tr>
<%
    String prevBizCode = "";
    for (int idx = 0; idx < compList.size(); idx++) {
        CodeVO comp = compList.get(idx);

        if (comp.getUpperValue().equals(prevBizCode) != true) {
            prevBizCode = comp.getUpperValue();

            if (idx == 0)
                out.println("                                        <td class=\"first\">");
            else if (prevBizCode.equals(bizList.get(bizList.size() - 1).getValue()) == true) {
%>
                                                            </ul>
                                                        </td>
                                                        <td class="last">
<%
            }
            else {
%>
                                                            </ul>
                                                        </td>
                                                        <td>
<%
            }

            out.println("                                            <ul>");
        }

        out.println("                                                <li><a href=\"./JobIntroduction.do?compType=" + comp.getValue() + "&page=1\">" + comp.getNameKo() + "</a></li>");
    }
%>
                                                            </ul>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <a href="#" class="compListClose"><img src="/hmg/images/web/kor/btn/btn-close.gif" alt="닫기" /></a>
                                        </div>
                                    </div>

                                    <!--//companyWrap-->
                                    <div class="introduction">
                                        <ul class="jobList">
                                            <li><a href="./JobIntroduction.do?compType=<%= compType %>&page=1"<%= searchKeyword.equals("") ? " class=\"on\"" : "" %>>전체</a></li><!-- 선택시 a class = on -->
<%
    for (int idx = 1; idx <= funcList.size(); idx++) {
        String className = "";
        if ((idx + 1) % 5 == 0)
            className = " class=\"last\"";

        out.println("                                            <li" + className + "><a href=\"#\" onclick=\"javascript:fn_move_by_func('" + funcList.get(idx - 1).getLink1() + "');\"" + ( searchKeyword.equals(funcList.get(idx - 1).getLink1()) ? " class=\"on\"" : "") + ">" + funcList.get(idx - 1).getLink1() + "</a></li>");
    }
%>
                                        </ul>
<%
    String prevJob = "";
    for (int idx = 0; idx < introList.size(); idx++) {
        BoardVO intro = introList.get(idx);

        if (intro.getLink1().equals(prevJob) != true) {
            prevJob = intro.getLink1();

            if (idx == 0) {
%>
                                        <div class="section last">
                                            <div class="jobTitle">
                                                <p class="title"><%= intro.getLink1() %></p>
<%              if (intro.getLink2() != null && intro.getLink2().length() > 0) { %>
                                                <p><%= intro.getLink2() %></p>
<%              } %>
                                            </div>
<%              if (intro.getTitle() != null || intro.getWebContent() != null) { %>
                                            <dl>
<%                  if (intro.getTitle() != null) { %>
                                                <dt><%= intro.getTitle() %></dt>
<%
                    }
                    if (intro.getWebContent() != null) {
%>
                                                <dd><%= intro.getWebContent() %></dd>
<%                  } %>
                                            </dl>
<%
                }
            }
            else if (prevJob.equals(introList.get(introList.size() - 1).getLink1()) == true) {
%>
                                        </div>
                                        <div class="section last">
                                            <div class="jobTitle">
                                                <p class="title"><%= intro.getLink1() %></p>
<%              if (intro.getLink2() != null && intro.getLink2().length() > 0) { %>
                                                <p><%= intro.getLink2() %></p>
<%              } %>
                                            </div>
<%              if (intro.getTitle() != null || intro.getWebContent() != null) { %>
                                            <dl>
<%                  if (intro.getTitle() != null) { %>
                                                <dt><%= intro.getTitle() %></dt>
<%
                    }
                    if (intro.getWebContent() != null) {
%>
                                                <dd><%= intro.getWebContent() %></dd>
<%                  } %>
                                            </dl>
<%
                }
            }
            else {
%>
                                        </div>
                                        <div class="section last">
                                            <div class="jobTitle">
                                                <p class="title"><%= intro.getLink1() %></p>
<%              if (intro.getLink2() != null && intro.getLink2().length() > 0) { %>
                                                <p><%= intro.getLink2() %></p>
<%              } %>
                                            </div>

<%              if (intro.getTitle() != null || intro.getWebContent() != null) { %>
                                            <dl>
<%                  if (intro.getTitle() != null) { %>
                                                <dt><%= intro.getTitle() %></dt>
<%
                    }
                    if (intro.getWebContent() != null) {
%>
                                                <dd><%= intro.getWebContent() %></dd>
<%                  } %>
                                            </dl>
<%
                }
            }
        }
        else {
            if (intro.getTitle() != null || intro.getWebContent() != null) { %>
                                            <dl>
<%              if (intro.getTitle() != null) { %>
                                                <dt><%= intro.getTitle() %></dt>
<%
                }
                if (intro.getWebContent() != null) {
%>
                                                <dd><%= intro.getWebContent() %></dd>
<%              } %>
                                            </dl>
<%
            }
        }
    }
%>
                                        </div>
                                    </div>
                                </div>
                                <div class="gropnews_page" id="paging_div">
                                    <div class="gropnews_page_left">
                                        <ul id="paging"></ul>
                                    </div>

                                    <div class="gropnews_page_right">
                                        <ul>
                                            <li><a href="javascript:fn_move_page('prev');"><img src="/hmg/images/web/kor/btn/btn_prev.gif" alt="이전페이지로 이동" /></a></li>
                                            <li><a href="javascript:fn_move_page('next');"><img src="/hmg/images/web/kor/btn/btn_next.gif" alt="다음페이지로 이동" /></a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--// 내용 -->
                    </div>
                </div>
            </div>
        </div>
        <!--//container-->

        <hr />

        <div id="btn-top"><a href="#"><img src="/hmg/images/web/kor/common/move-top3.png" alt="TOP" /></a></div>

        <!--footer-->
        <%@ include file="/WEB-INF/jsp/web/kor/include/footerEtc.jspf" %>
        <!--//footer-->

    </div>
    <!--//wrap-->
</body>
</html>